package org.jeecg.modules.demo.mes.service.impl;

import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.mes.entity.MesMaterialDetails;
import org.jeecg.modules.demo.mes.mapper.MesMaterialDetailsMapper;
import org.jeecg.modules.demo.mes.service.IMesMaterialDetailsService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @Description: 物料明细表
 * @Author: jeecg-boot
 * @Date:   2022-10-27
 * @Version: V1.0
 */
@Service
public class MesMaterialDetailsServiceImpl extends ServiceImpl<MesMaterialDetailsMapper, MesMaterialDetails> implements IMesMaterialDetailsService {

    /**
     * 通用查询
     */
    @Override
    public List<MesMaterialDetails> queryMaterialDetailsSelective(Map<String, Object> cxMap) {
        return this.baseMapper.queryMaterialDetailsSelective(cxMap);
    }

    @Override
    @Transactional(readOnly = false,isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    public void removeByMainId(String mainId) throws JeecgBootException {
        this.baseMapper.removeByMainId(mainId);
    }

    @Override
    @Transactional(readOnly = false,isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    public void resetMaterialDetailByProcedureMaterialBomId(String procedureMaterialBomId) throws JeecgBootException {
        this.baseMapper.resetMaterialDetailByProcedureMaterialBomId(procedureMaterialBomId);
    }
}
